﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BackGround_DetailInfo : System.Web.UI.Page
{
    Operation operation = new Operation();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Admin"] == null)
            {
                WebMessageBox.Show("会话失效，请重新登录！");
            }
            else
            {
                txtLinkMan.Text = Session["Admin"].ToString();             
            }
        }
       
    }
    protected void imgBtnAdd_Click(object sender, ImageClickEventArgs e)
    {
       
        operation.InsertInfo("新闻信息", txtTitle.Text.Trim(), txtInfo.Value.Trim(), txtLinkMan.Text.Trim(), "123", 0, "0");
        if (RadioButtonList1.Items[0].Selected==true)
        {
            Response.Redirect("image.aspx");
        }
        else if(RadioButtonList1.Items[1].Selected==true)
        {
            Response.Redirect("CheckInfo.aspx?id=新闻信息");
        }
        else Response.Write("<Script Language='JavaScript'>if ( window.confirm('是否为该新闻添加图片新闻？')) {  window.location.href='image.aspx' } else {window.location.href='CheckInfo.aspx?id=新闻信息' };</script>");

        // WebMessageBox.Show("新闻发布成功", "CheckInfo.aspx?id=新闻信息");
    }
   
}
